<%@ Page Language="C#" MasterPageFile="~/MasterPageMcSigAdmin.master" AutoEventWireup="true"
    CodeFile="SigPlanProgramaModificacionCDPs.aspx.cs" Inherits="SigPlanProgramaModificacionCDPs"
    Title="Modificacion EPs" %>

<%@ Register Assembly="FUA" Namespace="Subgurim.Controles" TagPrefix="cc2" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
<%@ Register Assembly="Anthem" Namespace="Anthem" TagPrefix="anthem" %>
<%@ Register Assembly="UsrControls" Namespace="UsrControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<h1 class="presupuesto">Modificacion Eps</h1>
    <cc1:WccAcciones CssClass="toolbar" ID="WccAcciones1" runat="server" OnAudit_OnClick="WccAcciones1_Audit_OnClick"
        UpdateOnClickFunction="" />
    <cc1:PopupPanelConsultarAuditoria ID="popupPanelConsultarAuditoria" runat="server">
    </cc1:PopupPanelConsultarAuditoria>
    <dxwgv:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False"
        CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue"
        DataSourceID="SqlDataSource1" KeyFieldName="FAE_ID" Width="100%" 
        OnRowUpdated="ASPxGridView1_RowUpdated" 
        OnRowValidating="ASPxGridView1_RowValidating" Theme="PlasticBlue">
        <SettingsPager ShowDefaultImages="False">
            <AllButton Text="All">
            </AllButton>
            <NextPageButton Text="Next &gt;">
            </NextPageButton>
            <PrevPageButton Text="&lt; Prev">
            </PrevPageButton>
        </SettingsPager>
        <Images SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css">
            <LoadingPanelOnStatusBar Url="~/App_Themes/PlasticBlue/GridView/gvLoadingOnStatusBar.gif">
            </LoadingPanelOnStatusBar>
            <LoadingPanel Url="~/App_Themes/PlasticBlue/GridView/Loading.gif">
            </LoadingPanel>
        </Images>
        <Styles CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue">
                                                    <Header ImageSpacing="10px" SortingImageSpacing="10px">
                                                    </Header>
                                                   
                                                </Styles>
        <Columns>
            <dxwgv:GridViewCommandColumn VisibleIndex="0">
                <EditButton Text="Editar" Visible="True">
                </EditButton>
                <NewButton Text="Nuevo">
                </NewButton>
                <DeleteButton Text="Borrar">
                </DeleteButton>
                <CancelButton Text="Cancelar" Visible="True">
                </CancelButton>
                <UpdateButton Text="Guardar" Visible="True">
                </UpdateButton>
                <ClearFilterButton Visible="True">
                </ClearFilterButton>
            </dxwgv:GridViewCommandColumn>
            <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="1">
                <ClearFilterButton Visible="True">
                </ClearFilterButton>
            </dxwgv:GridViewCommandColumn>
            <dxwgv:GridViewDataTextColumn FieldName="FAE_ID" ReadOnly="True" Visible="False"
                VisibleIndex="0">
                <EditFormSettings Visible="False" />
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn Caption="N&#250;mero EP" FieldName="FAE_NUMEROEPE"
                ReadOnly="True" VisibleIndex="2">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn Caption="Valor EP" FieldName="FAE_VALOR_EPE" VisibleIndex="3">
                <PropertiesTextEdit DisplayFormatString="{0:N0}">
                </PropertiesTextEdit>
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn Caption="N&#250;mero CDP" FieldName="FAE_NUMERO_CDP"
                ReadOnly="True" VisibleIndex="4">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn Caption="Valor CDP" FieldName="FAE_VALOR_CDP" VisibleIndex="5">
                <PropertiesTextEdit DisplayFormatString="{0:N0}">
                </PropertiesTextEdit>
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn Caption="Objeto" FieldName="FAE_OBJETO" ReadOnly="True"
                VisibleIndex="6">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn Caption="Motivo modificaci&#243;n" FieldName="CFE_JUSTIFICACION"
                VisibleIndex="7">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn Caption="A&#241;o" FieldName="ANO" VisibleIndex="8">
                <EditFormSettings Visible="False" />
            </dxwgv:GridViewDataTextColumn>
        </Columns>
        <TotalSummary>
            <dxwgv:ASPxSummaryItem DisplayFormat="${0:N0}" FieldName="FAE_VALOR_CDP" ShowInColumn="FAE_VALOR_CDP"
                SummaryType="Sum" />
            <dxwgv:ASPxSummaryItem DisplayFormat="${0:N0}" FieldName="FAE_VALOR_EPE" ShowInColumn="FAE_VALOR_EPE"
                SummaryType="Sum" />
        </TotalSummary>
        <Settings ShowFilterRow="True" ShowFooter="True" ShowFilterBar="Visible" 
            ShowFilterRowMenu="True" />
        <ImagesFilterControl>
            <LoadingPanel Url="~/App_Themes/PlasticBlue/Editors/Loading.gif">
            </LoadingPanel>
        </ImagesFilterControl>
        <StylesEditors>
            <CalendarHeader Spacing="11px">
            </CalendarHeader>
            <ProgressBar Height="25px">
            </ProgressBar>
        </StylesEditors>
    </dxwgv:ASPxGridView>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MCSIGConnectionString %>"
        DeleteCommand="DELETE FROM [FIN_ACCION_EPE] WHERE [FAE_ID] = @FAE_ID" InsertCommand="INSERT INTO [FIN_ACCION_EPE] ([FAE_VALOR_EPE], [FAE_VALOR_CDP], [FAE_NUMERO_CDP], [FAE_JUSTIFICACION]) VALUES (@FAE_VALOR_EPE, @FAE_VALOR_CDP, @FAE_NUMERO_CDP, @FAE_JUSTIFICACION)"
        SelectCommand="SELECT [FAE_VALOR_EPE], [FAE_VALOR_CDP], [FAE_NUMERO_CDP], [FAE_OBJETO], [FAE_ID], [FAE_NUMEROEPE], '' AS CFE_JUSTIFICACION , YEAR(FAE_FECHA_CDP) AS ANO FROM [FIN_ACCION_EPE] WHERE [TPE_ID] = 8"
        UpdateCommand="UPDATE [FIN_ACCION_EPE] SET [FAE_NUMERO_CDP] = @FAE_NUMERO_CDP, [FAE_OBJETO] = @FAE_OBJETO WHERE [FAE_ID] = @FAE_ID">
        <DeleteParameters>
            <asp:Parameter Name="FAE_ID" Type="Decimal" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="FAE_VALOR_EPE" Type="Decimal" />
            <asp:Parameter Name="FAE_VALOR_CDP" Type="Decimal" />
            <asp:Parameter Name="FAE_NUMERO_CDP" Type="String" />
            <asp:Parameter Name="FAE_OBJETO" Type="String" />
            <asp:Parameter Name="FAE_ID" Type="Decimal" />
            <asp:Parameter Name="CFE_JUSTIFICACION" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="FAE_VALOR_EPE" Type="Decimal" />
            <asp:Parameter Name="FAE_VALOR_CDP" Type="Decimal" />
            <asp:Parameter Name="FAE_NUMERO_CDP" Type="String" />
            <asp:Parameter Name="FAE_OBJETO" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    <dxwgv:ASPxGridViewExporter ID="gridExport" runat="server" GridViewID="ASPxGridView1">
    </dxwgv:ASPxGridViewExporter>
    <br />
    <asp:Button ID="btnXlsExport" runat="server" OnClick="btnXlsExport_Click" Text="Exportar a XLS" CssClass="button m" />
</asp:Content>
